package com.rk.kbk.model;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.rk.kbk.common.DateJsonDeserializer;
import com.rk.kbk.common.DateJsonSerializer;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @CashRecord
 * @用户商家现金流水(cash_record)
 * @version : Ver 1.0
 */
@Entity
public class CashRecord implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * @备注:骑手测试
	 * @字段:id BIGINT(19)
	 */
	@Id
	@GeneratedValue(strategy= GenerationType.IDENTITY)
	@GenericGenerator(name="auto-identity",strategy="identity")
	@Column(updatable = false, columnDefinition="BIGINT(19) COMMENT '骑手测试'")
	private java.lang.Long id;

	/**
	 * @备注:骑手/商家id
	 * @字段:user BIGINT(19)
	 */
	@ManyToOne
	@JoinColumn(name="user", columnDefinition="BIGINT(19) COMMENT '骑手/商家id'")
	private User user;

	/**
	 * @备注:标题
	 * @字段:title VARCHAR(255)
	 */
	@Column(columnDefinition="VARCHAR(255) COMMENT '标题'")
	private java.lang.String title;

	/**
	 * @备注:交易单号
	 * @字段:transaction_num VARCHAR(255)
	 */
	@Column(columnDefinition="VARCHAR(255) COMMENT '交易单号'")
	private java.lang.String transactionNum;

	/**
	 * @备注:商家单号
	 * @字段:merchant_num VARCHAR(255)
	 */
	@Column(columnDefinition="VARCHAR(255) COMMENT '商家单号'")
	private java.lang.String merchantNum;

	/**
	 * @备注:1表示配送订单，2表示商城订单，3表示其他
	 * @字段:order_type INT(10)
	 */
	@Column(columnDefinition="INT(10) COMMENT '1表示配送订单，2表示商城订单，3表示其他'")
	private java.lang.Integer orderType;

	/**
	 * @备注:订单编号
	 * @字段:order_number VARCHAR(255)
	 */
	@Column(columnDefinition="VARCHAR(255) COMMENT '订单编号'")
	private java.lang.String orderNumber;

	/**
	 * @备注:流水类型，1表示充值，2表示提现，3表示消费扣钱
	 * @字段:recoed_type INT(10)
	 */
	@Column(columnDefinition="INT(10) COMMENT '流水类型，1表示充值，2表示提现，3表示消费扣钱'")
	private java.lang.Integer recoedType;

	/**
	 * @备注:充值类型，1表示银联充值，2表示支付宝充值，3表示微信充值，4表示押金到余额,5表示余额到押金
	 * @字段:recharge_type INT(10)
	 */
	@Column(columnDefinition="INT(10) COMMENT '充值类型，1表示银联充值，2表示支付宝充值，3表示微信充值，4表示押金到余额,5表示余额到押金'")
	private java.lang.Integer rechargeType;

	/**
	 * @备注:1表示余额，2表示押金
	 * @字段:money_type INT(10)
	 */
	@Column(columnDefinition="INT(10) COMMENT '1表示余额，2表示押金'")
	private java.lang.Integer moneyType;

	/**
	 * @备注:具体数额
	 * @字段:money DOUBLE(22)
	 */
	@Column(columnDefinition="DOUBLE(22) COMMENT '具体数额'")
	private java.lang.Double money;

	/**
	 * @备注:支付类型：1表示余额支付，2表示支付宝支付，3表示微信支付
	 * @字段:pay_type INT(10)
	 */
	@Column(columnDefinition="INT(10) COMMENT '支付类型：1表示余额支付，2表示支付宝支付，3表示微信支付'")
	private java.lang.Integer payType;

	/**
	 * @备注:0表示不成功，1表示成功（提现改状态为null）
	 * @字段:status INT(10)
	 */
	@Column(columnDefinition="INT(10) COMMENT '0表示不成功，1表示成功（提现改状态为null）'")
	private java.lang.Integer status;

	/**
	 * @备注:银行名称
	 * @字段:bank_name VARCHAR(255)
	 */
	@Column(columnDefinition="VARCHAR(255) COMMENT '银行名称'")
	private java.lang.String bankName;

	/**
	 * @备注:持卡人姓名
	 * @字段:bank_card_name VARCHAR(255)
	 */
	@Column(columnDefinition="VARCHAR(255) COMMENT '持卡人姓名'")
	private java.lang.String bankCardName;

	/**
	 * @备注:银行卡号
	 * @字段:bank_card VARCHAR(255)
	 */
	@Column(columnDefinition="VARCHAR(255) COMMENT '银行卡号'")
	private java.lang.String bankCard;

	/**
	 * @备注:提现状态:默认1申请中,2已打款,3失败
	 * @字段:withdraw_status INT(10)
	 */
	@Column(columnDefinition="INT(10) COMMENT '提现状态:默认1申请中,2已打款,3失败'")
	private java.lang.Integer withdrawStatus;

	/**
	 * @备注:创建时间
	 * @字段:gmt_datetime DATETIME(19)
	 */
	@Column(updatable = false, columnDefinition="DATETIME(19) COMMENT '创建时间'")
	@JsonSerialize(using=DateJsonSerializer.class)
	@JsonDeserialize(using=DateJsonDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
	private java.util.Date gmtDatetime = new java.util.Date();

	/**
	 * @备注:更新时间
	 * @字段:upt_datetime DATETIME(19)
	 */
	@Column(columnDefinition="DATETIME(19) COMMENT '更新时间'")
	@JsonSerialize(using=DateJsonSerializer.class)
	@JsonDeserialize(using=DateJsonDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
	private java.util.Date uptDatetime = new java.util.Date();

	 private java.lang.Integer givePerson;

	 private java.lang.Integer receivePerson;






	public CashRecord(){
	}

	public CashRecord(
		java.lang.Long id
	){
		this.id = id;
	}



	public void setId(java.lang.Long id) {
		this.id = id;
	}

	public java.lang.Long getId() {
		return this.id;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public void setTitle(java.lang.String title) {
		this.title = title;
	}

	public java.lang.String getTitle() {
		return this.title;
	}


	public void setTransactionNum(java.lang.String transactionNum) {
		this.transactionNum = transactionNum;
	}

	public java.lang.String getTransactionNum() {
		return this.transactionNum;
	}


	public void setMerchantNum(java.lang.String merchantNum) {
		this.merchantNum = merchantNum;
	}

	public java.lang.String getMerchantNum() {
		return this.merchantNum;
	}


	public void setOrderType(java.lang.Integer orderType) {
		this.orderType = orderType;
	}

	public java.lang.Integer getOrderType() {
		return this.orderType;
	}


	public void setOrderNumber(java.lang.String orderNumber) {
		this.orderNumber = orderNumber;
	}

	public java.lang.String getOrderNumber() {
		return this.orderNumber;
	}


	public void setRecoedType(java.lang.Integer recoedType) {
		this.recoedType = recoedType;
	}

	public java.lang.Integer getRecoedType() {
		return this.recoedType;
	}


	public void setRechargeType(java.lang.Integer rechargeType) {
		this.rechargeType = rechargeType;
	}

	public java.lang.Integer getRechargeType() {
		return this.rechargeType;
	}


	public void setMoneyType(java.lang.Integer moneyType) {
		this.moneyType = moneyType;
	}

	public java.lang.Integer getMoneyType() {
		return this.moneyType;
	}


	public void setMoney(java.lang.Double money) {
		this.money = money;
	}

	public java.lang.Double getMoney() {
		return this.money;
	}


	public void setPayType(java.lang.Integer payType) {
		this.payType = payType;
	}

	public java.lang.Integer getPayType() {
		return this.payType;
	}


	public void setStatus(java.lang.Integer status) {
		this.status = status;
	}

	public java.lang.Integer getStatus() {
		return this.status;
	}


	public void setBankName(java.lang.String bankName) {
		this.bankName = bankName;
	}

	public java.lang.String getBankName() {
		return this.bankName;
	}


	public void setBankCardName(java.lang.String bankCardName) {
		this.bankCardName = bankCardName;
	}

	public java.lang.String getBankCardName() {
		return this.bankCardName;
	}


	public void setBankCard(java.lang.String bankCard) {
		this.bankCard = bankCard;
	}

	public java.lang.String getBankCard() {
		return this.bankCard;
	}


	public void setWithdrawStatus(java.lang.Integer withdrawStatus) {
		this.withdrawStatus = withdrawStatus;
	}

	public java.lang.Integer getWithdrawStatus() {
		return this.withdrawStatus;
	}


	public void setGmtDatetime(java.util.Date gmtDatetime) {
		this.gmtDatetime = gmtDatetime;
	}

	public java.util.Date getGmtDatetime() {
		return this.gmtDatetime;
	}


	public void setUptDatetime(java.util.Date uptDatetime) {
		this.uptDatetime = uptDatetime;
	}

	public java.util.Date getUptDatetime() {
		return this.uptDatetime;
	}

	public Integer getGivePerson() {
		return givePerson;
	}

	public void setGivePerson(Integer givePerson) {
		this.givePerson = givePerson;
	}

	public Integer getReceivePerson() {
		return receivePerson;
	}

	public void setReceivePerson(Integer receivePerson) {
		this.receivePerson = receivePerson;
	}
}
